# 1+2*3+4/2
str1 = '1+2*3*4-4/2'
res = [i for i in str1]
while '*' in res or '/' in res:
    for i in range(len(res)):
        if res[i] == '*':
            t = int(res[i-1]) * int(res[i+1])
            res[i] = t
            res.pop(i-1)
            res.pop(i)
            break
    for i in range(len(res)):
        if res[i] == '/':
            t = int(res[i-1]) / int(res[i+1])
            res[i] = t
            res.pop(i-1)
            res.pop(i)
            break
    print(res)